﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.JobDomain;
using Zocono.WCS.Infrastructure.ApllicationDto.WCSTaskDto;
using Zocono.WCS.Infrastructure.ApllicationDto;

namespace Zocono.WCS.Application.AppConfigureManage
{
    public class JobInfoApp
    {
        private readonly IJobInfoService _JobInfoService;
        public JobInfoApp(IJobInfoService jobInfoService)
        {
            _JobInfoService = jobInfoService;
        }

        public async Task<PageDto<JobInfo>> GetPagedJobInfoAsync(QueryJobInfoDto queryJobInfo)
        {
            return await _JobInfoService.GetPagedJobInfoAsync(queryJobInfo);
        }

        public async Task<List<JobInfo>> GetJobInfoListAsync()
        {
            return await _JobInfoService.GetJobInfoListAsync();
        }

        public async Task<bool> CreateJobInfoAsync(JobInfo jobInfo)
        {
            return await _JobInfoService.CreateJobInfoAsync(jobInfo);
        }

        public async Task<bool> ModifyJobInfoAsync(JobInfo jobInfo)
        {
            return await _JobInfoService.ModifyJobInfoAsync(jobInfo);
        }

        public async Task<bool> DeleteJobInfoAsync(List<JobInfo> jobInfoList)
        {
            return await _JobInfoService.DeleteJobInfoAsync(jobInfoList);
        }

        public async Task<JobInfo> GetJobInfoByIdAsync(long id)
        {
            var jobInfo = await _JobInfoService.GetJobInfoByIdAsync(id);
            return jobInfo;
        }

        public async Task<bool> DelectJobInfoByIdAsync(long id)
        {
            var res = await _JobInfoService.DelectJobInfoByIdAsync(id);
            return res;
        }

        
        public async Task<JobInfo> GetJobInfoByJobNameAsync(string jobName)
        {
            var jobInfo = await _JobInfoService.GetJobInfoByJobNameAsync(jobName);
            return jobInfo;
        }
    }
}
